const { Controller } = require('egg');

class BaseController extends Controller {
  async success({ data, status }) {
    const { ctx } = this;
    ctx.body = {
      code: 1,
      message: 'successed',
      data: data,
    };
    ctx.status = status || 200;
  }
}

module.exports = BaseController;
